# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py3-pydyf
_pyname=pydyf
pkgver=0.2.0
pkgrel=0
pkgdesc="A low-level PDF generator"
url="https://pypi.org/project/pydyf/"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-flit-core py3-build py3-installer"
checkdepends="
	ghostscript
	py3-coverage
	py3-pillow
	py3-pytest
	py3-pytest-cov
	py3-pytest-flake8
	py3-pytest-isort
	py3-pytest-xdist
	"
_pypiprefix="${_pyname%"${_pyname#?}"}"
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

prepare() {
	default_prepare

	# If you're going to make your test suite fail on flake8 errors you should
	# at least run it before you ship a release
	sed -i pyproject.toml -e 's/ --flake8//'
}

build() {
	python3 -m build --no-isolation --wheel
}

check() {
	pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/pydyf-$pkgver-py3-none-any.whl
}

sha512sums="
93d29b2783f3bc62b9ff2bb0d1414051805c508e17cf9607e44a31ec11c5436fef499e3f1bd225c193ccbda03feb7d32196286d984121fe1dbb65d02ea1dcf43  pydyf-0.2.0.tar.gz
"
